/**
 * Created by aaronjin on 16/11/24.
 */

var Unit = require('./unit.js');
module.exports = function (env) {
    try {
        var _default = [];
        var _result = {};
        var _entry = require('../conf/entry.json');
        var _cdn = require('../conf/cdn.json');
        var _port = require('../conf/port.json');
        if (env.ver == 'dev') {
            _default.push('webpack-dev-server/client?' + _cdn[env.ver]+':'+_port[env.project]);
            _default.push('webpack/hot/only-dev-server');
        }
        _entry = _entry[env.project];
        Unit.loopObject(_entry, _result);
        for (var item in _result) {
            _result[item] = Unit.pushArray(_result[item], _default);
        }
        return _result;
    } catch (e) {
        throw new Error(e);
    }

};

